﻿<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
		<META HTTP-EQUIV="Expires" CONTENT="0">
		<title><s:text name="title" /></title>
	</head>
	<body>
		<p>
			<a href="../mainService/main.action"><s:text name="return" /> </a>
			<a href="../login/logOut.action"><s:text name="logOut" /> </a>
		</p>
		<s:actionerror />
		<s:fielderror />
		<p>
			<b><s:text name="userInfo" /> </b>
		</p>
		<s:if test="#session.user.type==3">
			<s:form action="updateUser" namespace="/mainService">
				<s:hidden name="user.id"></s:hidden>
				<table cellspacing="1" cellpadding="1" border="1">
					<s:if test="method==null||method=='insert'">
						<tr>
							<td align="right">
								<s:text name="userName" />
							</td>
							<td align="left">
								<s:textfield name="user.userName" maxlength="20"/>
							</td>
						</tr>
						<tr>
							<td align="right">
								<s:text name="password" />
							</td>
							<td>
								<s:password name="user.password" size="21" maxlength="20"/>
							</td>
						</tr>
					</s:if>
					<s:else>
					<tr>
						<td align="right">
							<s:text name="userName" />
						</td>
						<td align="left">
							<s:textfield name="user.userName" readonly="true" maxlength="20"/>
						</td>
					</tr>
					</s:else>
					<tr>
						<td align="right">
							<s:text name="realName" />
						</td>
						<td>
							<s:textfield name="user.realName" maxlength="20"/>
						</td>
					</tr>
					<tr>
						<td align="right">
							<s:text name="idCard" />
						</td>
						<td>
							<s:textfield name="user.idCard" maxlength="18"/>
						</td>
					</tr>				
					<s:if test="method==null&&user==null">
						<tr>
							<td align="right">
								<s:text name="type" />
							</td>
							<td><s:bean id="insertUser" name="com.booking.mainService.actions.ModifyUserAction" ></s:bean>
								<s:select list="#insertUser.userTypeMap" listKey="key" listValue="value" name="user.type"></s:select>
							</td>
						</tr>
					</s:if>
					<s:else>
						<tr>
							<td align="right">
								<s:text name="type" />
							</td>
							<td>
								<s:select list="userTypeMap" listKey="key" listValue="value" name="user.type"></s:select>
							</td>
						</tr>
					</s:else>
					<s:if test="'query'==method||'update'==method">
					<tr>
						<td align="right">
							<s:submit key="update"></s:submit>
						</td>
						<td align="left">
							<input type="button" value="<s:text name='delete'/>" onclick="this.form.action='/booking/mainService/deleteUser.action';this.form.submit();">
						</td>
					</tr>
					</s:if>
					<s:else>
						<tr>
							<td align="right">
								<input type="button" value="<s:text name='insert'/>" onclick="this.form.action='/booking/mainService/insertUser.action';this.form.submit();">
							</td>
							<td></td>
						</tr>
					</s:else>
				</table>
			</s:form>
		</s:if>
	</body>
</html>
